// 储能规划相关接口
import request from '@/utils/request'

// 获取服务商信息（从token接口获取）
export const getServiceProviderApi = () => request.get('/token')

// 分页列表
export const getEnergyStoragePlanningPageApi = (params) =>
  request.get('/mgd-microservice-biz/mgd/energy/storage/plan/page', { params })

// 查询电价方案列表
export const getElectricSchemeApi = (params) =>
  request.get(
    '/mgd-microservice-biz/mgd/energy/storage/plan/getElectricScheme',
    {
      params
    }
  )

// 第一步新增或修改
export const stepOneAddOrUpdateApi = (data) =>
  request.post(
    '/mgd-microservice-biz/mgd/energy/storage/plan/step/one/add/or/update',
    data
  )

// 解析第二步导入数据
export const stepTwoImportApi = (formData) =>
  request.post(
    '/mgd-microservice-biz/mgd/energy/storage/plan/step/two/import',
    formData,
    {
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    }
  )

// 第二步新增或修改
export const stepTwoAddOrUpdateApi = (data) =>
  request.post(
    '/mgd-microservice-biz/mgd/energy/storage/plan/step/two/add/or/update',
    data
  )

// 第三步新增或修改
export const stepThreeAddOrUpdateApi = (data) =>
  request.post(
    '/mgd-microservice-biz/mgd/energy/storage/plan/step/three/add/or/update',
    data
  )

// 第四步新增或修改
export const stepFourAddOrUpdateApi = (data) =>
  request.post(
    '/mgd-microservice-biz/mgd/energy/storage/plan/step/four/add/or/update',
    data
  )

// 第五步新增或修改
export const stepFiveAddOrUpdateApi = (data) =>
  request.post(
    '/mgd-microservice-biz/mgd/energy/storage/plan/step/five/add/or/update',
    data
  )

// 删除储能规划
export const deleteEnergyStoragePlanApi = (params) =>
  request({
    url: '/mgd-microservice-biz/mgd/energy/storage/plan/delete',
    method: 'post',
    params
  })

// 根据id查询某条规划详情
export const getEnergyStoragePlanByIdApi = (params) =>
  request.get('/mgd-microservice-biz/mgd/energy/storage/plan/getEnergyStoragePlanById', { params })
